package cn.edu.zzuli.message.config;

import cn.edu.zzuli.model.dto.ChatMessage;
import cn.edu.zzuli.model.entity.WebMessage;
import cn.edu.zzuli.model.vo.wx.SendMessage;
import com.alibaba.fastjson.JSON;

import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;

public class ChatCustomEncoding implements Encoder.Text<SendMessage> {
    @Override
    public String encode(SendMessage sendMessage) {
        assert sendMessage!=null;
        return JSON.toJSONString(sendMessage);
    }

    @Override
    public void init(EndpointConfig endpointConfig) {

    }

    @Override
    public void destroy() {

    }
}
